<?php
/**
 * Various general functions
 * @package uniCRM
 * @version 1.0b
 */

/**
 * Checks if we actually have a user logged in
 * @return boolean
 */
function CheckSession(){
	return (!empty($_SESSION['current_user']) && !empty($_SESSION['current_credentials']));
}

/**
 * Custon uniCRM hash function
 * Uses salting method and sha512 algorithm
 * @var clear password
 * @return crypted password
 */
function UnicrmHash($password){
	// Changing this variable WILL RESULT in the loss of all accounts
	$salt = '!-Eprec7Aj-yE#APhadR!N*pREPaze=@';
	
	return hash('sha512', $salt.$password);
}
?>